﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：TestBase.cs
// 功能描述：TongTongMall.MallWeb.Test
// 
// Create User：jym 2017/02/09
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using Castle.MicroKernel.Registration;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TongTongMall.Dapper;
using TongTongMall.Dapper.Registrar;
using TongTongMall.Dependecy;
using TongTongMall.MallWeb.Application.Configuration.Session;
using TongTongMall.MallWeb.Test;
using TongTongMall.TestBase;
using TongTongMall.TestBase.TestBase.Session;

namespace TongTongMall.Tests
{
    public class TongTongMallTestBase : IntegratedTestBase
    {

        public TongTongMallTestBase()
        {
            if (!IsRegister)
            {
                var repositoryRegistrar = LocalIocManager.IocContainer.Resolve<DapperGenericRepositoryRegistrar>();
                repositoryRegistrar.RegisterForDbContext(typeof(DapperModelSet), LocalIocManager);

                LocalIocManager.IocContainer.Register(Component.For(typeof(IDbProviderFactory)).ImplementedBy(typeof(DbsFactory)).LifestyleTransient());
            }
        }
    }
}
